/**   
 * @Title: SendPushInfoCommunicater.java 
 * @Package com.esun.rabbit2.communicaters.option 
 * @Description: 上传push个开关状态信息通信接口
 * @author: Billy Qigs@500wan.com   
 * @date: Jul 23, 2012 11:41:49 AM  
 * Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.option;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.config.Config;
import com.esun.config.Key;
import com.esun.model.UserInfo;
import com.esun.network.ServerCommunicater;
import com.esun.util.HashMapUtil;

/**
 * @ClassName: SendPushInfoCommunicater
 * @Description:上传push个开关状态信息通信接口
 * @author: Billy Qigs@500wan.com
 * @date: Jul 23, 2012 11:41:49 AM
 * 
 */
public class SendPushInfoCommunicater extends ServerCommunicater {

	/**
	 * @Title: isSendSucceed
	 * @Description: 上传用户开奖推送状态
	 * @param: @param serial push唯一吗
	 * @param: @param masterState 推送总开关状态
	 * @param: @param lotidList 开奖推送彩种列表
	 * @param: @param pushStateList 开奖推送开关状态列表
	 * @param: @param isFirstActivite 是否首次激活
	 * @param: @return 是否上传成功
	 * @param: @throws ClientProtocolException
	 * @param: @throws IOException
	 * @param: @throws ParserConfigurationException
	 * @param: @throws SAXException 设定文件
	 */
	public boolean isSendSucceed(String serial, String masterState, String lotidList, String pushStateList) throws ClientProtocolException, IOException, ParserConfigurationException, SAXException {
		boolean isSucceed = false;
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();

		list.add(HashMapUtil.getMapItem(BussinessCode.PASER_MID, BussinessCode.MID_SEND_PUSH_INFO));
		list.add(HashMapUtil.getMapItem(BussinessCode.PASER_CK, UserInfo.getUserInfo().getUserSession()));
		list.add(HashMapUtil.getMapItem(Key.KEY_USERNAME, UserInfo.getUserInfo().getUserName()));
		list.add(HashMapUtil.getMapItem(Key.KEY_USERIMEI, serial));
		list.add(HashMapUtil.getMapItem(Key.KEY_DID, Config.NUM1));
		list.add(HashMapUtil.getMapItem(Key.KEY_DIDSTATE, masterState));
		list.add(HashMapUtil.getMapItem(Key.KEY_LOTIDSTR, lotidList));
		list.add(HashMapUtil.getMapItem(Key.KEY_ISPUSHSTR, pushStateList));

		super.getServerResponse(list, true);

		if (super.getState() == 100) {
			isSucceed = true;
		}

		return isSucceed;
	}

}
